﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MiUi.ShuaMiHelper;

namespace MiUi.ShuaMi
{
    public partial class FrmSet : Form
    {
        public FrmSet()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 设置相关用户事件
        /// </summary>
        public event Action<MiUiUser> eventSetMiUiUser;


        private void FrmSet_Load(object sender, EventArgs e)
        {
            //this.tbUserName.Text="605064709@163.com";
            //this.tbPwd.Text="qsiofg4nui";
            this.tbThreadStartId.Text="10000";
        }
        //确定
        private void btnSure_Click(object sender, EventArgs e)
        {
            if (eventSetMiUiUser != null)
            {
                MiUiUser miuiUser = new MiUiUser();
                miuiUser.UserName = this.tbUserName.Text.Trim();
                miuiUser.Password = this.tbPwd.Text;

                miuiUser.ThreadStartId = ConvertHelper.AsInt(this.tbThreadStartId.Text, 10000);
                eventSetMiUiUser(miuiUser);
            }
            this.Close();
        }

        //取消
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        
    }
}
